package com.five.community.mapper;

import com.five.community.bean.Role;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface RoleMapper {

    // 查询全部数据
    List<Role> selectAll() throws Exception;

    // 根据角色id查询角色对应权限的id
    List<Long> selectPIdsByRId(long id) throws Exception;

    // 插入数据
    void insert(Role role) throws Exception;

    // 向角色权限表插入数据
    void insertPermission(@Param("rid") long rid, @Param("pid") long pid) throws Exception;

    //根据id查询角色信息
    Role selectById(int id) throws Exception;
}
